package com.cxria.problem.dto

import com.cxria.problem.enums.StatusCodeEnum
import com.cxria.problem.enums.StatusMsgEnum

class Status<T> {

	static final String SUCCESS = 'success'
	static final String ERROR = 'error'

	String status = SUCCESS
	String statusCode = StatusCodeEnum.NORMAL.toString()
	String statusMsg = StatusMsgEnum.NORMAL.toString()

	Object entity

	Status() {

	}

	Status(T entity) {
		this.entity = entity
	}

	Status(String status, StatusCodeEnum statusCode, String msg) {
		this.status = status
		this.statusCode = statusCode.toString()
		this.statusMsg = msg
	}

	Status(String status, StatusCodeEnum statusCode, StatusMsgEnum statusMsgEnum) {
		this.status = status
		this.statusCode = statusCode.toString()
		this.statusMsg = statusMsgEnum.toString()
	}

}
